import CarController.CarController;
import FirefightingTruck.FirefightingTruckAdapter;
import SprinklerTruck.SprinklerTruckAdapter;

public class Main {
    public static void main(String[] args) {
        CarController car;
        try{
            for (String className :new ReadXml("src//config.xml").readCarNameByXml()){
                Class classReflection = Class.forName(className);
                Object object = classReflection.getDeclaredConstructor().newInstance();
                car = (CarController) object;
                car.move();
                car.horns();
                car.message();
            }
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}